<%@page language="java" pageEncoding="UTF-8"%>    
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="orest.front.achieve.GetOptionAction"%>
<%@ page import="orest.common.valueobject.*" %>
<%@ page import="orest.common.util.* "%>
<%@page import="orest.front.achieve.AchieveHandler"%>
<%@page import="net.ssta.core.db.Record"%>
<%@page import="net.ssta.core.db.RecordSet"%>
<%@page import="java.net.*" %> 
<%@page import="java.util.*"%> 

<%
	response.setHeader("ContentType","text/xml");  
    response.setHeader("Pragma","No-Cache");   
    response.setDateHeader("Expires",0);   
    response.setHeader("Cache-Control","No-Cache");  
%>

<%  
	String path = request.getContextPath();
	String keyword = request.getParameter("key");
	
	
	String topicname = request.getParameter("topicname");
    if (topicname ==null) topicname="";
    //key=NewEnergyClass1=3 AND NewEnergyClass2=8
    //key=NewEnergyClass1=1&topicname=安全标准与理论
    String key = request.getParameter("key");
    if (key ==null) key="";
    
    if(keyword.equals("ChannelShow='1'")){
    	topicname = "推荐成果";
    }
    
    System.out.println("sea_res接收:"+keyword);
    if(keyword == null ) keyword="";
    //utf-8 根据服务器的编码页定 有可能是gbk
    keyword = java.net.URLEncoder.encode(keyword,"utf-8");
   // keyword = new sun.misc.BASE64Encoder().encode(keyword.getBytes());   
    
    System.out.println("sea_res编码后:"+keyword);
    
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>   
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目信息－国家安科网</title>
<!-- 
<link rel="stylesheet" type="text/css" href="../common/css/style.css" />
 -->

<link href="<%=path%>/common1/css/layout.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/common1/css/user.css" rel="stylesheet" type="text/css" />


<script language = "javascript" src = "../common/js/list.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/pool.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/page.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/check.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/search.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/setcondition.js" type = "text/javascript"></script>
<script type="text/javascript" src="<%=path%>/includes/styleBase/js/jquery.js"></script>


<script language="javascript">


//查看科技成果
function viewKjcg(kjcgid,kjcgname){
	window.open("<%=path%>/achieve1/info.jsp?kjcgid="+$.trim(kjcgid)+"&title="+$.trim(kjcgname));
}

//推荐科技成果
function load_tjkjcg(divid,http){
	$.ajax({
		type:"POST",
		url:http,
		error:function(msg)
		{
			//alert("操作失败，请重试！"+msg);
		},
	    success:function(data)
	    {
	    	var data = eval("("+data+")");
			var html="";
			var showcount = 10;
			var i=0;
			for(i=0;i<data.length&&i<showcount;i++){
				var kjcgname = data[i]['kjcgname'];
				html+="<li>";
				html+="<a href='#2012' style=\"width:100%\" onclick=\"viewKjcg('"+data[i]['kjcgid']+"')\">"+kjcgname.substring(0,20)+"</a></li>";
				//html+="<span>";
				//html+=data[i]['unitname'].substring(0,8);
				//html+="</span>";
			}
			for(var j=i;j<showcount;j++){
				html+="<li><a style=\"width:100%\" href=\"#\"></a></li>";
			}
			$("#"+divid).html(html);
		}
	});
}



var topicname = "";
$("document").ready(function()
{
		
		//按键登录
	    $("#item_3").keydown(function(e){ 
			 var curkey = e.which; 
			 if(curkey == 13){
				doSearch();
	         }
	    });
		
		searchkeyword = "<%=keyword%>";
        topicname = "<%=topicname%>";
        //alert('<%=keyword%>');
 	    url = "http://" + location.host + "/SSTA/achieve/agent/doSearch.jsp?keyword=<%=keyword%>&no=1&count=5&jtime=" + (new Date()).getTime();       
        XmlHttpPool.GetRemoteData(url,showKjcgResult);
        //getNewEnergyList("7");
        
        //加载推荐科技成果
		var http = "<%=path%>/front/AchieveServlet?method=getRecommendKjcgList&showType=ChannelShow";
		load_tjkjcg("zylist",http);
		
});




</script>		
<xml id="resultDom"></xml>
</head>

<body>

<%@include file="../common1/toplogin.jsp"%>
<%@include file="../common1/topbanner.jsp"%>
<%@include file="../common1/topmenu.jsp"%>












<!--页面主体部分-->
<div id="contentmain">
	
	
	<div id="all_content_right">
		<form id="searchform" name="searchform" action="<%=path%>/achieve1/search_results.jsp" method="post" >
		    <div id="topsearchbox_695">
					<ul>
						<li><img src="<%=path%>/common/images/search/icon.gif" /></li>
						<li><span class="bluetitle">关键字</span></li>
						<li>
							 <input type="text" style="width:0px;border:0px;" />
							 <input type="text" name="item_3" id="item_3" size="18" style="margin-top:4px;" />
		                     <input type="hidden" name="topicname" id="topicname" value=""/>
		                 　   　		 <input type="hidden" name="key" id="key" value=""/>
						</li>
						<li>
							<a href="javascript:doSearch();">
								<img  src="<%=path%>/common/images/search/botton1.gif" style="border:0px;margin-top:2px;"/>
							</a>
						</li>
						<li>
							<a href="<%=path%>/achieve1/advancedsearch.jsp" target="_self">高级搜索</a>
						</li>
						<li>
							<a href="<%=path%>/achieve1/needforachieve.jsp" target="_self">帮您找项目</a>
						</li>
					</ul>
			</div>
		</form>
		
		
		
					 
                    　　　
		
		<div id="topsearchbox_695">
				<ul>
					<li id="blue_title"></li>
				</ul>
		</div>
		
		<div id="border_box">
		    <div id="ind_title">
		    	<%if(key.indexOf("NewEnergyClass1")!=-1&&key.indexOf("NewEnergyClass2")!=-1){
			    		String kjcgTypeStr = "";
			    		String kjcgType1="";//一级分类号
						String optName_temp1 = "";//一级分类名称
			    		String kjcgType2="";//二级分类号
						String optName_temp2 = "";//二级分类名称
			    		
			    		RecordSet flRecSet = AchieveHandler.getNewEnergyClassList();
			    		
			    		if(key.indexOf("NewEnergyClass2")!=-1){
					    	kjcgType1  = key.substring(key.indexOf("NewEnergyClass1"), key.indexOf("NewEnergyClass2"));
					    }
					    kjcgType1 = kjcgType1.replaceAll("NewEnergyClass1","");
					    kjcgType1 = kjcgType1.replaceAll("=","");
					    kjcgType1 = kjcgType1.replaceAll("'","");
					    kjcgType1 = kjcgType1.replaceAll("and","");
					    kjcgType1 = kjcgType1.replaceAll("AND","");
					    kjcgType1 = kjcgType1.replaceAll(" ","");
					    kjcgType1 = kjcgType1.replaceAll("　","");
					    kjcgType1 = kjcgType1.trim();
					    
						for(int i=0;i<flRecSet.size();i++){
							Record record = flRecSet.get(i);
							String optValue = record.getString("OPTIONVALUE","");
							String optName = record.getString("OPTIONNAME",""); 
							if(optValue.equals(kjcgType1)){
								optName_temp1 = optName;
							}
						}
						
						
						if(key.indexOf("NewEnergyClass2")!=-1){
					    	kjcgType2  = key.substring(key.indexOf("NewEnergyClass2"));
					    }
					    
					    kjcgType2 = kjcgType2.replaceAll("NewEnergyClass2","");
					    kjcgType2 = kjcgType2.replaceAll("=","");
					    kjcgType2 = kjcgType2.replaceAll("'","");
					    kjcgType2 = kjcgType2.replaceAll(" ","");
					    kjcgType2 = kjcgType2.replaceAll("　","");
					    kjcgType2 = kjcgType2.replace(")", "");
					    
						optName_temp2 = topicname;
						
						if(optName_temp2.indexOf("—")!=-1){
							optName_temp2=optName_temp2.substring(optName_temp2.indexOf("—"));
							optName_temp2=optName_temp2.replaceAll("—","");
						}
						
						
						
		    	%>
		    		<font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp?kjcgType=<%=kjcgType1%>" class="blue"><%=optName_temp1%></a> > <a href="<%=path%>/achieve1/search_results.jsp?key=NewEnergyClass1=<%=kjcgType1%> AND NewEnergyClass2=<%=kjcgType2%>&topicname=<%=optName_temp2%>" class="blue"><%=optName_temp2%></a></font><span></span>
		    	<%}else if(key.indexOf("NewEnergyClass1")!=-1){%>
		    		<font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a> > <a href="<%=path%>/achieve1/search_results.jsp?key=<%=key%>&topicname=<%=topicname%>" class="blue"><%=topicname%></a></font><span></span>
		    	<%}else{%>
		    		<font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a> > 查询结果</font><span></span>
		    	<%}%>
		    </div>
			<div name="kjcg_res" id="kjcg_res" style="height:auto;padding-bottom:30px;">
				
			</div>
			
			<div id="progressbar" class="bar_progress">数据加载中,请稍候......</div>
			
		</div>
	</div>
	
	
	
	<div id="all_content_left">
    	<div style="border:0px;">
    	<%@include file="../common/adleft.jsp"%>
    	</div>
		<div id="border_box_orange">
		    <div id="ind_title_cont_righttitle"><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue"><font>推荐成果</font></a><span><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue">更多...</a></span></div>
			<ul id="zylist">
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
			</ul>
		</div>
	</div>
	
	
</div>

<%@include file="../common1/bottom.jsp"%>

</body>
</html>

